<header class="head_content_wrapper p-3 bg-dark text-white sticky-top">
        <div class="container xcontainer">
            <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
                <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none"><img src="https://cdn.aiqingyu1314.com/age/statics/images/logo.png?v=2024042101" height="38"></a>
                <ul class="head-nav nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0 ml-2">
                    <li><a
                        {% if request.path == '/' %}
                        class="nav-link  active"
                        {% endif %}
                        href='{% url "main:index" %}' class="nav-link">首页</a></li>
                    <li><a
                        {% if request.path == '/catalog/' %}
                        class="nav-link  active"
                        {% endif %}
                        href='{% url "main:catalog" %}' class="nav-link ">目录</a></li>
                    <li><a
                        {% if request.path == '/recommend/' %}
                        class="nav-link  active"
                        {% endif %}
                        href='{% url "main:recommend" %}' class="nav-link ">每日推荐</a></li>
                    <li><a
                        {% if request.path == '/rank/' %}
                        class="nav-link  active"
                        {% endif %}
                        href='{% url "main:rank" %}' class="nav-link ">排行榜</a></li>
                </ul>
                <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3 search-form" onsubmit="return $('#query').val().length > 0;" action="/search" method="GET">
                    <div class="input-group">
                        <input name="q" id="query" type="search" class="form-control form-control-sm form-control-dark" placeholder="输入番名搜索" maxlength="8" value="">
                        <button class="btn btn-sm btn-outline-secondary" type="submit" id="button-addon2"><i class="bi bi-search"></i></button>
                    </div>
                </form>
                <div class="text-end">
                    {% if not request.user.is_authenticated %}
                    <a href='{% url "user:login" %}' id="btnLogAndReg" type="button" class="btn btn-sm btn-danger">登录</a>
                    <a href='{% url "user:regist" %}' id="btnLogAndReg2" type="button" class="btn btn-sm btn-danger">注册</a>

                    {% else %}
                    <div class="btn-group history_link_wrapper">

                    </div>
                    <a id="userAvatar" class="user_avatar_link" href='{% url "user:center" %}' style="display: inline-block;"><img class="user_avatar rounded-circle" src="/media/{{ request.user.head }}"></a>
                    {% endif %}
                </div>
            </div>
        </div>
</header>